package admin.common.domain.rsp;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;


/**
 * @author helen
 * @since 2019/12/25
 */
@Schema(description = "响应对象")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class R<T> implements Serializable {
    private static final long serialVersionUID = -1242493306307174690L;

    @Schema(description = "错误码，非 0 表示失败")
    private Integer code;
    @Schema(description = "错误信息")
    private String msg;
    @Schema(description = "响应信息")
    private String message;
    @Schema(description = "响应数据")
    private T data;

    @Schema(description = "tenant_access_token")
    @JsonProperty("tenant_access_token")
    private String tenantAccessToken;

    @Schema(description = "app_access_token")
    @JsonProperty("app_access_token")
    private String appAccessToken;

    @Schema(description = "expire")
    @JsonProperty("expire")
    private int expire;


     public static R feiginError() {
        return R.builder().code(400).msg("feign失败").build();
    }





}
